package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractMasterEntity;

/** @author Hibernate CodeGenerator */
public class Inventory extends AbstractMasterEntity implements Serializable {

	/** persistent field */
    private String code;

    /** persistent field */
    private com.ces.knacky.model.Item item;

    /** persistent field */
    private Set orderInventories;

    /** full constructor */
    public Inventory(String code, Date createTime, Date updateTime, com.ces.knacky.model.Flag flag, com.ces.knacky.model.Item item, com.ces.knacky.model.UserTable user, Set orderInventories) {
        this.code = code;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.flag = flag;
        this.item = item;
        this.user = user;
        this.orderInventories = orderInventories;
    }

    /** default constructor */
    public Inventory() {
    }

    /** minimal constructor */
    public Inventory(String code, com.ces.knacky.model.Flag flag, com.ces.knacky.model.Item item, com.ces.knacky.model.UserTable user, Set orderInventories) {
        this.code = code;
        this.flag = flag;
        this.item = item;
        this.user = user;
        this.orderInventories = orderInventories;
    }

   public String getCode() {
        return this.code;
    }

    public void setCode(String inventoryCode) {
        this.code = inventoryCode;
    }

    public com.ces.knacky.model.Flag getFlag() {
        return this.flag;
    }

    public void setFlag(com.ces.knacky.model.Flag flag) {
        this.flag = flag;
    }

    public com.ces.knacky.model.Item getItem() {
        return this.item;
    }

    public void setItem(com.ces.knacky.model.Item item) {
        this.item = item;
    }

    public com.ces.knacky.model.UserTable getUser() {
        return this.user;
    }

    public void setUser(com.ces.knacky.model.UserTable user) {
        this.user = user;
    }

    public Set getOrderInventories() {
        return this.orderInventories;
    }

    public void setOrderInventories(Set orderInventories) {
        this.orderInventories = orderInventories;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Inventory) ) return false;
        Inventory castOther = (Inventory) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }


}
